import request from '../request.js';

// 获取赛事列表
export const getVenueList = () => {
  return request({
    url: '/venue/getAllMerchant',
    method: 'get',
  });
};



export const getStadiumList = (merchantId) => {
  return request({
    url: '/venue/getAllStadium',
    method: 'get',
	params: { merchantId }
  });
};

//插入预约表
  export function insertBookings(data) {
    return request({
      url: '/venue/insertBookings',
      method: 'post',
      data: data
    })
  }

 //插入订单
  export function insertOrder(data) {
    return request({
      url: '/venue/reservation',
      method: 'post',
      data: data
    })
  }
  
  //修改订单的支付状态
  export function updateOrderStatus(orderId) {
    return request({
      url: '/venue/updateOrderStatus',
      method: 'put',
      params: { 
        orderId
      }
    });
  }
  
  //判断当前球场是不是被预约 
export function isReservation(userId, stadiumId) {
  return request({
    url: '/venue/isReservation',
    method: 'GET', // 保证方法是大写
    params: { 
      userId,       // 参数会自动映射
      stadiumId
    }
  });
}

